/**
 * Popover Component Style for tingle
 * $author wenzhao.fw
 *
 * Copyright 2014-2016, Tingle Team.
 * All rights reserved.
 */
// Base class
$popover-zindex = 1020
$popover-popup-zindex = 1000
$popover-fill-mask = $dark-alpha-6
$popover-spacing = 16px
$popover-radius = 4px
$popover-arrow-width = 8px

.{$prefix}-popover {
  position: absolute;
  z-index: $popover-zindex;

  &-hidden {
    display: none;
  }

  &-mask {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    background-color: $popover-fill-mask;
    height: 100%;
    z-index: $popover-popup-zindex;
    &-hidden {
      display: none;
    }
  }
}

// Arrows
.{$prefix}-popover-arrow {
  position: absolute;
  width: $popover-arrow-width;
  height: $popover-arrow-width;
  border-radius: 2px;
  background-color: $white-alpha-1;
  transform: rotate(45deg);
  z-index: 0;
}

.{$prefix}-popover {
  &-placement-top &-arrow,
  &-placement-topLeft &-arrow,
  &-placement-topRight &-arrow {
    transform: rotate(225deg);
    bottom: -($popover-arrow-width/2);
  }

  &-placement-top &-arrow {
    left: 50%;
  }

  &-placement-topLeft &-arrow {
    left: $popover-spacing;
  }

  &-placement-topRight &-arrow {
    right: $popover-spacing;
  }

  &-placement-right &-arrow,
  &-placement-rightTop &-arrow,
  &-placement-rightBottom &-arrow {
    transform: rotate(-45deg);
    left: -($popover-arrow-width/2);
  }

  &-placement-right &-arrow {
    top: 50%;
  }

  &-placement-rightTop &-arrow {
    top: $popover-spacing;
  }

  &-placement-rightBottom &-arrow {
    bottom: $popover-spacing;
  }

  &-placement-left &-arrow,
  &-placement-leftTop &-arrow,
  &-placement-leftBottom &-arrow {
    transform: rotate(135deg);
    right: -($popover-arrow-width/2);
  }

  &-placement-left &-arrow {
    top: 50%;
  }

  &-placement-leftTop &-arrow {
    top: $popover-spacing;
  }

  &-placement-leftBottom &-arrow {
    bottom: $popover-spacing;
  }

  &-placement-bottom &-arrow,
  &-placement-bottomLeft &-arrow,
  &-placement-bottomRight &-arrow {
    top: -($popover-arrow-width/2);
  }

  &-placement-bottom &-arrow {
    left: 50%;
  }

  &-placement-bottomLeft &-arrow {
    left: $popover-spacing;
  }

  &-placement-bottomRight &-arrow {
    right: $popover-spacing;
  }
}

.{$prefix}-popover-inner {
  color: $dark-alpha-2;
  background-color: $white-alpha-1;
  border-radius: $popover-radius;
  box-shadow: $box-shadow-1;
  overflow: hidden;
}

.{$prefix}-popover-menu {
  .{$prefix}-menu-submenu {
    &:last-child {
      border-bottom: none;
      .{$prefix}-menu-submenu-unit {
        border-bottom: none;
      }
    }
  }
  .{$prefix}-menu-submenu-unit {
    padding: 12px 0;
    height: 46px;
    margin: 0 8px;
  }
}
